library(ravana)
init_cluster('Ravana', settingspath = 'C:/R')
is_prime <- function(n) {
n == 2L || all(n %% 2L:max(2,floor(sqrt(n))) != 0)
}
#check these numbers if they are primes
numbers_to_check <- seq(10001, 10201, 2)
#share the function in the cluster
share_function(is_prime)
#share the object in the cluster
share_object(numbers_to_check)
taskid <- ravana_map(is_prime, numbers_to_check)
res = ravana_reduce(taskid)
#print all the Prime numbers found through this process
print(res[res$mappedresults==TRUE,]$mappedparameters)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.